package com.example.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;

@Controller
public class testController {
    //在templates目录下的所有页面,只能通过controller来跳转  (类似于SpringMVC的WEB-INF目录下的文件)
    //这个需要模板引擎的支持  比如 thymeleaf
    @RequestMapping("/test")
    public String test(Model model){
        model.addAttribute("msg", "hello, thymeleaf! ");
        model.addAttribute("users", Arrays.asList("Tom", "Jerry", "Jacky"));
        return "test";
    }
}
